import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import AdminView from "@/views/AdminView.vue";
import Index from "@/views/Index.vue";
import UserView from "@/views/UserView.vue";
import SystemView from "@/views/SystemView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: LoginView
  },
  {
    path: '/admin',
    name: 'admin',
    component: AdminView,
    children: [
      {
        path: '',
        name: 'Index',
        component: Index
      },
      {
        path: 'user',
        name: 'user',
        component: UserView
      },
      {
        path: 'system',
        name: 'system',
        component: SystemView
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
